<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\UserController;
use App\Http\Controllers\Api\LoginController;
use App\Http\Controllers\Api\MiniController;
use App\Http\Controllers\Api\CorpController;
use App\Http\Controllers\Api\ShortController;
use App\Http\Controllers\Api\PriceController;
use App\Http\Controllers\Api\DomainController;
use App\Http\Controllers\Api\UploadController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['prefix' => 'version/{vid}', 'namespace' => 'Api'], function () {
    Route::group(['prefix' => 'login'], function() {
        Route::get('get_openid', [LoginController::class, 'getOpenid']);
        Route::get('user_login', [LoginController::class, 'userLogin']);
        Route::get('user_refresh', [LoginController::class, 'userRefresh']);
        Route::get('corp_type', [LoginController::class, 'corpType']);
        Route::get('get_phone', [LoginController::class, 'getPhone']);
        Route::get('corp_qrcode', [LoginController::class, 'corpQrcode']);
    });
    Route::group(['prefix' => 'nimi'], function() {
        Route::get('msg_sec_check', [MiniController::class, 'msgSecCheck']);
        Route::get('products', [PriceController::class, 'products']);
        Route::get('wechat_member', [PriceController::class, 'wechatMember']);
        Route::any('wechat_back', [PriceController::class, 'wechatBack']);
    });

    Route::group(['prefix' => 'upload'], function() {
        Route::get('access_token', [UploadController::class, 'uploadAccessToken']);
        Route::any('back',[UploadController::class,'uploadBack']);
    });

    Route::group(['prefix' => 'corp'], function() {
        Route::post('corp_add', [CorpController::class, 'corpAdd']);
        Route::get('corp_list', [CorpController::class, 'corpList']);
        Route::get('corp_detial', [CorpController::class, 'corpDetial']);
        Route::get('corp_sample', [CorpController::class, 'corpSample']);
        Route::post('apply', [CorpController::class, 'corpApply']);
        Route::get('apply_last', [CorpController::class, 'corpApplyLast']);
        Route::post('corp_update', [CorpController::class, 'corpUpdate']);
        Route::get('corp_statistic', [CorpController::class, 'corpStatistic']);
        Route::get('corp_del', [CorpController::class, 'corpDel']);
        Route::post('corp_user_join', [CorpController::class, 'corpUserJoin']);
        Route::get('corp_user', [CorpController::class, 'corpUser']);
        Route::get('user_check', [CorpController::class, 'userCheck']);
        Route::get('corp_user_list', [CorpController::class, 'corpUserList']);
        Route::get('apply_check', [CorpController::class, 'applyListCheck']);
        Route::get('apply_list', [CorpController::class, 'applyList']);
        Route::get('apply_result', [CorpController::class, 'applyResult']);
        Route::get('apply_status', [CorpController::class, 'applyStatus']);
        Route::get('apply_detial', [CorpController::class, 'applyDetial']);
        Route::get('group_list', [CorpController::class, 'groupList']);
        Route::get('group_add', [CorpController::class, 'groupAdd']);
        Route::get('group_sort', [CorpController::class, 'groupSort']);
        Route::get('group_update', [CorpController::class, 'groupUpdate']);
    });

    Route::group(['prefix' => 'check'], function() {
        Route::post('corp_check', [CorpController::class, 'corpAdd']);
        Route::get('check_record', [CorpController::class, 'checkRecord']);
        Route::post('check_record_add', [CorpController::class, 'checkRecordAdd']);
        Route::get('check_result', [CorpController::class, 'checkResult']);
    });

    Route::group(['prefix' => 'short'], function() {
        Route::get('list', [ShortController::class, 'shortList']);
        Route::post('short_add', [ShortController::class, 'shortAdd']);
        Route::get('short_del', [ShortController::class, 'shortDel']);
        Route::get('short_detial', [ShortController::class, 'shortDetial']);
        Route::post('short_update', [ShortController::class, 'shortUpdate']);
        Route::get('short_static', [ShortController::class, 'shortStatic']);
        Route::get('short_detial_static', [ShortController::class, 'shortDetialStatic']);
        Route::get('group_list', [ShortController::class, 'groupList']);
        Route::get('group_add', [ShortController::class, 'groupAdd']);
        Route::get('group_del', [ShortController::class, 'groupDelete']);
        Route::get('short_record', [ShortController::class, 'shortRecord']);
        Route::get('record_static', [ShortController::class, 'recordStatic']);
    });
    Route::group(['prefix' => 'user'], function() {
        Route::get('users_profile', [UserController::class, 'usersProfile']);
        Route::post('users_profile_submit', [UserController::class, 'usersProfileSubmit']);
        Route::get('corp_list', [UserController::class, 'corpList']);
        Route::get('apply_list', [UserController::class, 'applyList']);
        Route::get('corp_del', [UserController::class, 'corpDelete']);
        
        Route::get('domain_buy', [DomainController::class, 'domainBuy']);
        Route::get('domain_sale', [DomainController::class, 'domainSale']);
        Route::get('sale_domain', [DomainController::class, 'saleDomain']);
        Route::get('order_list', [UserController::class, 'orderList']);
        Route::post('user_setting', [UserController::class, 'userSetting']);
    });
    Route::group(['prefix' => 'yaohao'], function() {
        Route::get('record_list', [YaohaoController::class, 'recordList']);
        Route::get('record_add', [YaohaoController::class, 'recordListAdd']);
        Route::get('record_delete', [YaohaoController::class, 'recordListDelete']);
    });
});
